package com.example.fina2202.day06;

public class RecursionDemo02 {
    public static void main(String[] args) {
//        int result = f(20);
//        System.out.println(result);

        for (int i=1;i<=20;i++){
            int result = f(i);
            System.out.print(result+" ");
        }
    }

    public static int f(int pos){
        if (pos==1)
            return 1;
        return f(pos-1)+f(pos-2);
    }
}
